<template>
  <div>
    <el-form-item v-if="activeData.config.tag === 'el-select'" label="能否搜索">
      <el-switch v-model="activeData.filterable" />
    </el-form-item>
    <el-form-item v-if="activeData.config.tag === 'el-select'" label="是否多选">
      <el-switch v-model="activeData.multiple" @change="multipleChange" />
    </el-form-item>
    <config-item-option :active-data="activeData" />
  </div>
</template>

<script>
import ConfigItemOption from './option'

export default {
  name: 'ConfigItemSelect',
  components: { ConfigItemOption },
  props: ['activeData'],
  methods: {
    multipleChange(val) {
      this.$set(this.activeData.config, 'defaultValue', val ? [] : '')
    }
  }
}
</script>

<style scoped></style>
